package com.card.hwatt.entity;

import java.util.Date;
import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;

/**
 * 休假
 * @author Administrator
 *
 */
@Entity
@Table(name = "T_Leave")
public class Leave {
	
	@Id
	@GeneratedValue(generator = "generator")
	@GenericGenerator(name = "generator", strategy = "assigned")
	@Column(name = "LeaveID", length = 36)
	@Type(type = "uuid-char")
	public UUID id;

	/**
	 * 录入日期
	 */
	@Column(name = "`Date`", nullable = false)
	public Date date;
	
	@ManyToOne(cascade = {})
	@JoinColumn(name = "EmployeeID", nullable = false)
	public Employee employee;
	
	/**
	 * 请假关键字
	 */
	@Column(name = "`Key`", length = 2, nullable = false)
	public String key;
	
	/**
	 * 请假类型
	 */
	@Column(name = "`Name`", length = 20, nullable = false)
	public String name;
	
	/**
	 * 日期
	 */
	@Column(name = "`Value`", length = 8, nullable = false)
	public String value;
	
	/**
	 * 原因
	 */
	@Column(name = "`Reason`", length = 250)
	public String reason;
}
